package com.yunduo.world.component;

import com.yunduo.world.config.NettyConfig;
import jakarta.annotation.Resource;
import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Component;

/**
 * 优雅关闭
 */
@Component
public class GracefulShutdown implements SmartLifecycle {
    @Resource
    private NettyConfig config;

    @Override
    public void start() {

    }

    // 关闭netty线程池
    @Override
    public void stop() {
        config.closeGroup();
    }

    @Override
    public boolean isRunning() {
        return false;
    }
}
